<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>配置费率</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <form id="formSet1">
        <div class="fieldset1 tabel_col clearFix">
            <div class="fieldBox col_100_auto">
                <div class="label">方案编号</div>
                <div class="field">
                    <span name="programNo" id="programNo"> </span>
                </div>
            </div>
            <div class="fieldBox col_100_auto">
                <div class="label">机构名称</div>
                <div class="field">
                    <span name="orgNm" id="orgNm"> </span>
                </div>
            </div>
            <div class="fieldBox col_100_auto">
                <div class="label">业务</div>
                <div class="field">
                    <span name="busType" id="busType"> </span>
                </div>
            </div>
            <c:if test="${guaranteeType == '1'}">
                <div class="fieldBox col_100_auto">
                    <div class="label">机构放款日期</div>
                    <div class="field">
                        <span name="orgPayBeginToEnd" id="orgPayBeginToEnd"> </span>
                    </div>
                </div>
            </c:if>
            <c:if test="${guaranteeType == '1'}">
                <div class="fieldBox col_100_auto">
                    <div class="label">逾期天数</div>
                    <div class="field">
                        <span name="overdueBeginDayToEnd" id="overdueBeginDayToEnd"> </span>
                    </div>
                </div>
            </c:if>
            <div class="fieldBox col_100_auto">
                <div class="label">上报时间</div>
                <div class="field">
                    <span name="repBeginToEnd" id="repBeginToEnd"> </span>
                </div>
            </div>
            <div class="fieldBox col_100_auto">
                <div class="label">费率类型</div>
                <div class="field">
                    <span name="guarTypCdNm" id="guarTypCdNm"> </span>
                </div>
            </div>
            <div class="fieldBox col_100_auto">
                <div class="label">费率</div>
                <div class="field">
                    <span name="repRate" id="repRate"> </span>
                </div>
            </div>
            <div class="fieldBox col_100_auto">
                <div class="label">有效期</div>
                <div class="field">
                    <span name="enableBeginToEnd" id="enableBeginToEnd"> </span>
                </div>
            </div>
        </div>

        <div class="btnsBox" style="text-align: center;">
            <span id="cancelBtn" class="sq-button sq-button-round">关闭</span>
        </div>
    </form>
</div>


<script type="text/javascript">
    $(function(){
        //initTab();
        initData();
        SET_popupIframeHeight();
    });

    function initData(){
        var programNo = '${programNo}';
        if(!programNo) {
            $.ligerDialog.SQalert({content: "请刷新重试", SQ_type: "error"});
            return;
        }
        var _url = '<%=path%>/fgi/fgiguarrate/getByProgramNo.do?';
        $.ajax({
            type: 'get',
            dataType:'json',
            data:{programNo : programNo},
            url: _url,
            success:function(msg){
                if(msg.success == 1){
                    setData(msg.data);//设置数据
                }else{
                    $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
                }
            }
        });
    }

    //设置页面数据
    function setData(data){
        $("#programNo").html(data.programNo);
        $("#orgNm").html(data.orgNm);
        $("#busType").html(data.busType);
        $("#orgPayBeginToEnd").html(data.orgPayBeginToEnd);
        $("#overdueBeginDayToEnd").html(data.overdueBeginDayToEnd);
        $("#repBeginToEnd").html(data.repBeginToEnd);
        $("#repRate").html(data.repRate + '%');
        $("#enableBeginToEnd").html(data.enableBeginToEnd);
        $("#guarTypCdNm").html(data.guarTypCdNm);
    };

    $('#cancelBtn').click(function () {
        frameElement.dialog.close();
    });

</script>
</body>
</html>
